<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">

<head>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="Web前端视频教程,大数据视频教程,HTML5视频教程,UI视频教程,PHP视频教程,java视频教程,python基础教程">
    <meta name="description" content="智游教育在线课程视频,为您提供java,python,HTML5,UI,PHP,大数据等学科经典视频教程在线浏览学习,精细化知识点解析,深入浅出,想学不会都难,智游教育,学习成就梦想！">
    <meta name="author" content="尚忠祥">
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/profile.css">
    <link rel="icon" href="favicon.png" type="image/png">
    <title>在线公开课-智游教育|java|大数据|HTML5|python|UI|PHP视频教程</title>
	    <script src="js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript">
		$(function() {
			var sex = '${user.sex}';
			/* foreach循环!!!! */
			$("input[name='sex']").each(function(i, obj) {
				//obj是dom对象，不是jQuery对象
				//alert(obj.value+"---------"+sex);
				if ($(obj).val() == sex) {
					//obj.checked==true;----js的写法
					
					$(obj).attr("checked", true);
				}
	
			});
			var address = '${user.address}';//河南-郑州
	
			if (null != address && address != ""){
				var arr = address.split("-");
				//alert(address);
				$("#city").citySelect({
					prov : arr[0], //默认省份 
					city : arr[1], //默认城市
					nodata : "none"
				});
			} else {
				$("#city").citySelect({
					prov : "河南", //默认省份 
					city : "郑州", //默认城市
					nodata : "none"
				});
			}
	
		});
	
		function commitForm(){
			var address = $(".prov").val() + "-" + $(".city").val();
			
			$("#address").val(address);
			alert(address);
			//$("form").commit();-----是button按钮时需要加上commit，如果是submit则无需加
			return true;
		}
	</script>
</head>

<body class="w100">
    <header>
        <div class="container top_bar clearfix">
            <img src="img/logo.png" alt="智游">
            <div id="tele">
                <span>4006-371-555</span>
                <span>0371-88888598</span>
            </div>
        </div>
        <menu>
            <div class="container clearfix">
                <ul class="clearfix f_left">
                    <li><a href="./index.jsp">首页</a></li>
                    <li><a href="./course.html">课程</a></li>
                    <li><a href="#">关于我们</a></li>
                    <li class="menu_active"><a href="showMyProfile.action">个人中心</a></li>
                </ul>
                <div id="search_group">
                    <input type="text" placeholder="搜索课程">
                    <span id="search"></span>
                </div>
                <div id="user_bar">
                    <a href="./myProfile.html">
                      <c:if test="${empty user.imgurl}">
                                 <img  src="img/avatar_lg.png">
                            </c:if>
                            
                            <c:if test="${not empty user.imgurl}">
                                  <img  src="${user.imgurl}">
                       </c:if>
                    </a>
                    <a href="javascript:;" id="lay_out">退出</a>
                </div>
            </div>
        </menu>
    </header>
    <main>
        <div class="container">
            <h2>我的资料</h2>
            <div id="profile_tab">
                <ul class="profile_tab_header f_left clearfix">
                    <li class="profile_tab_active"><a href="changeProfile.action">更改资料</a></li>
                    <li class="profile_tab_line">|</li>
                    <li><a href="changeAvatar.action">更改头像</a></li>
                    <li class="profile_tab_line">|</li>
                    <li><a href="passwordSafe.action">密码安全</a></li>
                </ul>
                <div class="proflle_tab_body">
                    <h3><a href="./myProfile.html">返回个人中心</a></h3>
                    <div class="proflle_tab_workplace clearfix">
                        <div class="profile_avatar_area">
                            <img src="${user.imgurl}">
                        </div>
                        <div class="profile_ifo_area">
                            <form action="updateUser.action"><!-- 更新数据 -->
                              <input name="id" type="hidden" value="${user.id}" />
                                <div class="form_group">
                                    <span class="dd">昵&#x3000;称：</span><input type="text" name="nickname" value="${user.nickname}"/>
                                </div>
                                <div class="form_group">
                                    <span class="dd">性&#x3000;别：</span>
                                    <input type="radio" id="men" value="men" name="sex"><label for="men">男</label>
                                    <input type="radio" id="woman" value="woman" name="sex"><label for="woman">女</label>
                                </div>
                                <div class="form_group">
                                    <span class="dd">生&#x3000;日：</span>
                                    <input type="text"  name="birthday" value="${user.birthday}">
                                </div>
                                <div class="form_group">
                                    <span class="dd">邮&#x3000;箱：</span>
                                    <span class="">${user.email}</span>
                                   
                                </div>
                                <div class="form_group">
                                    <span class="dd">所在地：</span>
                                    <div id="city">
                                        <select class="prov" name="prov"></select>
                                        <select class="city" disabled="disabled" name="city"></select>
                                    </div>
                                    <!-- 提交地址 -->
                                    <input type="hidden" name="address" id="address" />
                                </div>
                                <div class="form_submit dd">
                                    <input type="submit" onclick="return commitForm();" value="保&#x3000;存">
                                    <a href="./change_profile.html">重置</a>
                                </div>
                                
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <footer>
        <div class="container">
            <ul>
                <li><img src="img/footer_logo.png" alt="" id="foot_logo"></li>
                <li>版权所有：智游3G教育&#x3000;&#x3000;&#x3000;&copy;&nbsp;www.zhiyou100.com</li>
                <li><img src="img/微信公众号.png" alt="" id="wxgzh"></li>
            </ul>
        </div>
    </footer>
</body>

<script src="js/jquery.cityselect.min.js"></script>
<script>
	// 省份二级联动
		/*  $("#city").citySelect({
		     prov: "河南",  //默认省份 
		     city: "郑州",  //默认城市
		     nodata: "none"
		 }); */

</script>
</html>







